<!DOCTYPE html>
<html>
<head>
   <meta name="layout" content="main" />
  <title>|Usuarios</title>

	<script type="text/javascript">
	$(function() {		
		$("#autocomplete").autocomplete({
			 source: "../usuario/ajaxAutoComplete",
    dataType: "json",
    minLength: 1,
    cache: false,
		});
	});
	</script>

    <script type="text/javascript" src="${createLinkTo(dir:'js',file:'tablesort.js')}" ></script>
<script type="text/javascript" src="${createLinkTo(dir:'js',file:'customsort.js')}" ></script>
<link rel="stylesheet" href="${createLinkTo(dir:'css',file:'gridsort.css')}" media="screen" />
</head>
<body>
  <div class="body">
  <g:ifAnyGranted role="ROLE_ADMIN" >
    <div class="space-me">
      <!-- layout element -->
    </div>
    <g:if test="${flash.message}">
      <div class="message">${flash.message}</div>
    </g:if>
    
<div class="list">
               <table class="sortable rowstyle-alt   no-arrow">
       
          <col width="10%" />
          <col width="80%" />
          <col width="10%" />

           <thead>
          <tr>
           <th class="sortable">login</th>
           <th class="sortable">Nome Completo</th>
           <th class="sortable">Status</th>
           
          </tr>
        </thead>
        <tbody>
          <g:each in="${personList}" status="i" var="person">
            <tr>
              <td>
                <g:link action="show" class="edit" id="${person.id}">
                  ${person.username?.encodeAsHTML()}
                </g:link>
              </td>
              <td>
                <g:link action="show" class="edit" id="${person.id}" style="${person.userRealName?.encodeAsHTML() !='TEMP'?'color:blue;':'color:red;'};cursor: pointer;" >
                  ${person.userRealName?.encodeAsHTML() =='TEMP'? 'Aguardando Usuario Realizar o Cadastro' : person.userRealName?.encodeAsHTML()}
              </g:link></td>
               <td valign="top"  style="${(person.enabled)?'color:green;':'color:red;'};cursor: pointer;"  class="value">${(person.enabled)?"Ativo":"Inativo"}</td>
          
          </tr>
            

          </g:each>
           <tfoot>
              <tr>

              <td class="total" colspan="2">Total</td>


            <td  class="totalnumero" > ${personList.size()}</td>
            </tr>
            </tfoot>

        </tbody>
      </table>
</div>
</g:ifAnyGranted>
  </div>
</body>
